﻿using System;
using System.Data;
using System.Text;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BaseData;
using BaseData.UI;
using TaxBiz.SysConfig;
using TaxBiz.Tax;

namespace Admin.Tax
{
    public partial class TaxTongji : BaseCommon.BasePage
    {
        protected int? departmentID = null;
        protected int? yearMin = null;
        protected int? yearMax = null;
        protected DataTable dtDepartmet = null;

        protected void Page_Load(object sender, EventArgs e)
        {
            this.InitData();
            //初始化绑定
            dtDepartmet = new DepartmentBiz().GetList();
            string action = PageContext.GetRequest("action");
            if (!string.IsNullOrEmpty(action))
            {
                if (action.Trim().ToLower() == "query")
                {
                    this.BindData();
                }
            }
        }

        protected void InitData()
        {
            departmentID = PageContext.GetRequestInt("selDepart");
            yearMax = PageContext.GetRequestInt("txtYearMax");
            yearMin = PageContext.GetRequestInt("txtYearMin"); 
        }

        protected void BindData()
        {
            DataTable dt = TaxTongjiBiz.GetList(yearMin.HasValue ? yearMin.Value : 0, yearMax.HasValue ? yearMax.Value : 0, departmentID.HasValue ? departmentID.Value : 0);
            this.rptDataList.DataSource = dt;
            this.rptDataList.DataBind();
        }
    }
}